cmd line tutorials - gencmd

cmd line tutorials - gencmd

The rmdir Command

Unix-Linux Mac

The rmdir command is a built-in shell command that is used to remove empty directories on Unix-like operating systems.

Syntax

The basic syntax for the rmdir command is as follows:

rmdir [options] <directory_name>

The <directory_name> argument is the name of the directory that you want to remove. The [options] argument is a list of options that can be used to modify the behavior of the rmdir command.

Examples

Remove the directory “my_directory” from the current directory.

rmdir my_directory

Remove the directory “/home/user/my_project” recursively.

rmdir -R /home/user/my_project

With gencmd

gencmd remove a dir

  • rmdir /tmp/foo